package comxin.demo1.nodestream;

import org.junit.Test;

import java.io.*;

public class Bufferedoutputstream {
    @Test
    public void method1() throws IOException {
        BufferedOutputStream bufferedOutputStream1=new BufferedOutputStream(new FileOutputStream("mybuffered"));
        bufferedOutputStream1.write("hello\r\n".getBytes());
        bufferedOutputStream1.write("world".getBytes());
        bufferedOutputStream1.close();
    }
    @Test
    public void method2() throws IOException {
        BufferedInputStream bufferedInputStream=new BufferedInputStream(new FileInputStream("mybuffered"));
        int temp;
        while ((temp=bufferedInputStream.read())!=-1){
            System.out.println(temp);
        }
    }
}
